package com.rural.bus;

import android.view.View;
import android.view.View.OnClickListener;
import android.widget.TextView;

import com.rural.bus.view.SlideItemDialog;
import com.rural.bus.view.SlideItemDialog.OnDialogDismissListener;
/***
 * 日租
 * @author majie
 *
 */
public class RentRailwayActivity extends CommonRailrayActivity{
	
//	private LinearLayout  ll_select_short_style;
	
	private TextView mTvRentType;
	
	private SlideItemDialog mRentTypeDialog;
	
	private String arr[]={"日租(8小时)","半日租(4小时)"};
	
	
//	@Override
//	protected void timeDialog() {
////		Calendar c=Calendar.getInstance();
////		String initEndDateTime=c.get(Calendar.YEAR)+"年"+(c.get(Calendar.MONTH)+1)+"月"
////		+c.get(Calendar.DAY_OF_MONTH)+"日 "+c.get(Calendar.HOUR_OF_DAY)+":"+c.get(Calendar.MINUTE);
////		DatePickDialogUtil dateTimePicKDialog = new DatePickDialogUtil(  
////                 this, initEndDateTime);  
////         dateTimePicKDialog.dateTimePicKDialog(mTvTime); 
//	}
	
	@Override
	protected void initView() {
		super.initView();
		mLlTime.setVisibility(View.GONE);
//		ll_select_short_style = (LinearLayout) findViewById(R.id.ll_select_short_style);
//		ll_select_short_style.setVisibility(View.VISIBLE);
		
		mTvRentType=(TextView) findViewById(R.id.tv_rent_type);
		mTvRentType.setVisibility(View.VISIBLE);

		mTvRentType.setText("租车类型：  日租(8小时)");
	}
	
	@Override
		protected void setListeners() {
			super.setListeners();
			
			mTvRentType.addTextChangedListener(mWatcher);
			
			mTvRentType.setOnClickListener(new OnClickListener() {
				
				@Override
				public void onClick(View arg0) {
					if (mRentTypeDialog == null) {
						mRentTypeDialog = new SlideItemDialog(RentRailwayActivity.this, "选择租车类型",arr, 0, new OnDialogDismissListener() {

							@Override
							public void onConfirmClicked(int index) {
								mTvRentType.setText("租车类型：  "+arr[index]);
								mergeId=index==0?1:0;
							}

							@Override
							public void onCancelClicked() {

							}

						});
					}
					mRentTypeDialog.show();
				}
			});
		}

}
